using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Zonal
{
    /// <summary>
    /// <para>Zonal Geometry</para>
    /// <para>Calculates the specified geometry measure (area, perimeter, thickness, or the characteristics of ellipse) for each zone in a dataset.</para>
    /// <para>计算数据集中每个区域的指定几何测量值（面积、周长、厚度或椭圆特征）。</para>
    /// </summary>    
    [DisplayName("Zonal Geometry")]
    public class ZonalGeometry : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ZonalGeometry()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_zone_data">
        /// <para>Input raster or feature zone data</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the zones.</para>
        ///   <para>The zones can be defined by an integer raster or a feature layer.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义区域的数据集。</para>
        ///   <para>区域可由整数栅格或要素图层定义。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_zone_field">
        /// <para>Zone field</para>
        /// <para><xdoc>
        ///   <para>The field that contains the values that define each zone.</para>
        ///   <para>It must be an integer field of the zone dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含定义每个区域的值的字段。</para>
        ///   <para>它必须是区域数据集的整数字段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output zonal geometry raster.</para>
        /// <para>输出分区几何栅格。</para>
        /// </param>
        public ZonalGeometry(object _in_zone_data, object _zone_field, object _out_raster)
        {
            this._in_zone_data = _in_zone_data;
            this._zone_field = _zone_field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Zonal Geometry";

        public override string CallName => "sa.ZonalGeometry";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_zone_data, _zone_field, _out_raster, _geometry_type.GetGPValue(), _cell_size];

        /// <summary>
        /// <para>Input raster or feature zone data</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the zones.</para>
        ///   <para>The zones can be defined by an integer raster or a feature layer.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义区域的数据集。</para>
        ///   <para>区域可由整数栅格或要素图层定义。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature zone data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_zone_data { get; set; }


        /// <summary>
        /// <para>Zone field</para>
        /// <para><xdoc>
        ///   <para>The field that contains the values that define each zone.</para>
        ///   <para>It must be an integer field of the zone dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含定义每个区域的值的字段。</para>
        ///   <para>它必须是区域数据集的整数字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _zone_field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output zonal geometry raster.</para>
        /// <para>输出分区几何栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Geometry type</para>
        /// <para><xdoc>
        ///   <para>Geometry type to be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Area—The area for each zone.</bullet_item><para/>
        ///     <bullet_item>Perimeter—The perimeter for each zone.</bullet_item><para/>
        ///     <bullet_item>Thickness—The deepest (or thickest) point within the zone from its surrounding cells.</bullet_item><para/>
        ///     <bullet_item>Centroid—Locates the centroids of each zone.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要计算的几何类型。</para>
        ///   <bulletList>
        ///     <bullet_item>区域 - 每个区域的面积。</bullet_item><para/>
        ///     <bullet_item>周长 - 每个区域的周长。</bullet_item><para/>
        ///     <bullet_item>厚度 - 区域内距其周围像元的最深（或最厚）点。</bullet_item><para/>
        ///     <bullet_item>质心 （Centroid） - 定位每个区域的质心。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Geometry type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _geometry_type_value _geometry_type { get; set; } = _geometry_type_value._AREA;

        public enum _geometry_type_value
        {
            /// <summary>
            /// <para>Area</para>
            /// <para>Area—The area for each zone.</para>
            /// <para>区域 - 每个区域的面积。</para>
            /// </summary>
            [Description("Area")]
            [GPEnumValue("AREA")]
            _AREA,

            /// <summary>
            /// <para>Perimeter</para>
            /// <para>Perimeter—The perimeter for each zone.</para>
            /// <para>周长 - 每个区域的周长。</para>
            /// </summary>
            [Description("Perimeter")]
            [GPEnumValue("PERIMETER")]
            _PERIMETER,

            /// <summary>
            /// <para>Thickness</para>
            /// <para>Thickness—The deepest (or thickest) point within the zone from its surrounding cells.</para>
            /// <para>厚度 - 区域内距其周围像元的最深（或最厚）点。</para>
            /// </summary>
            [Description("Thickness")]
            [GPEnumValue("THICKNESS")]
            _THICKNESS,

            /// <summary>
            /// <para>Centroid</para>
            /// <para>Centroid—Locates the centroids of each zone.</para>
            /// <para>质心 （Centroid） - 定位每个区域的质心。</para>
            /// </summary>
            [Description("Centroid")]
            [GPEnumValue("CENTROID")]
            _CENTROID,

        }

        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        public ZonalGeometry SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}